package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 用户积分表
 * </p>
 *
 * @author whale
 * @since 2025-05-09
 */
@TableName("tb_user_points")
public class UserPoints extends Model<UserPoints> {

    private static final long serialVersionUID = 1L;

    /**
     * 积分唯一标识
     */
    @TableId("point_id")
    private Long pointId;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 当前积分
     */
    private Integer points;
    /**
     * 积分变动描述
     */
    private String description;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 修改时间
     */
    @TableField("update_date")
    private Date updateDate;

    public UserPoints() {
        this.pointId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getPointId() {
        return pointId;
    }

    public void setPointId(Long pointId) {
        this.pointId = pointId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getPoints() {
        return points;
    }

    public void setPoints(Integer points) {
        this.points = points;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public String toString() {
        return "UserPoints{" +
        ", pointId=" + pointId +
        ", userId=" + userId +
        ", points=" + points +
        ", description=" + description +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
